package com.foreknow.demo11;

public class ExceptionDemo1 {
    public static void main(String[] args) {

        try {
            int[] arr = {1,2,3,4,5};
            for (int i = 0;i <= arr.length;i++) { //越界
                System.out.println(arr[i]);
            }
            System.out.println("111111111111111111111111111111111111");
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("我们需要处理异常...");
        }catch (NullPointerException e) {

        }catch (Exception e) {

        } finally {
            System.out.println("有没有异常都会输出");
        }
        System.out.println("程序继续向下执行");

    }

}
